IF EXIST "tmp\pack-all.js" del "tmp\pack-all.js"


cd src
for /f %%a in ('dir /b *.js') do call:AssembleFile: %%a
for /f %%a in ('dir /b *.css') do call:AssembleFile: %%a
cd ../
call:Compress
GOTO:EOF

:AssembleFile
IF NOT [%1]==[] call:AssembleFileEx: %1
GOTO:EOF

:AssembleFileEx
type %1  >> ..\tmp\pack-all.js
GOTO:EOF

:Compress
java -jar lib\yuicompressor-2.4.6.jar --type js --charset utf-8 tmp\pack-all.js -o result\pack-all-min.js
GOTO:EOF